/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package presentation.controller;

import businessLogic.facade.AlumnoFacade;
import java.net.InetAddress;
import vo.AlumnoVO;

/**
 *
 * @author Admin
 */
public class ControlPanelMiCuenta {
    
    public vo.AlumnoVO ObtenerDatos(String vo){
        AlumnoVO alumno = null;
        alumno = (AlumnoVO) new AlumnoFacade().find(vo);
        return alumno;
    }
    
    /**
     * Busca un usuario en base a su IP
     * @return El usuario buscado
     */
    public AlumnoVO FindByIp(){
        AlumnoVO al = null;
        try {
            InetAddress addr = InetAddress.getLocalHost();
            String ip = addr.getHostAddress();
            
            al = (AlumnoVO) new AlumnoFacade().FindByIp(ip + ".true");
        } 
        catch (Exception e) {
            System.out.println(e.getMessage());
        }
        
        return al;
    }
}
